﻿using UnityEngine;

namespace UGUIMan
{
    public class MapBox:MonoBehaviour
    {
        public bool left;
        private void OnTriggerEnter2D( Collider2D collision )
        {

            if (collision.gameObject.tag == "map")
            {
                if (left)
                {
                    Map.endmap = collision.gameObject.GetComponent<Mappiece>(); Debug.Log(Map.endmap.name);
                }
                else
                {
                    Map.startmap = collision.gameObject.GetComponent<Mappiece>();
                    Debug.Log(Map.startedmap.name);
                }
            }
        }
    }
}